<template>
  <div>
    <el-table
      :data="tableData"
      border
      style="width: 100%"
      :default-sort="{ prop: 'date', order: 'descending' }"
    >
      <el-table-column prop="imageUrl" label="产品图片" width="130">
        <template v-slot="{ row }">
          <img class="imgs" :src="row.imageUrl" alt="" />
        </template>
      </el-table-column>
      <el-table-column prop="productName" label="产品名称"></el-table-column>
      <el-table-column prop="description" label="产品描述"></el-table-column>
      <el-table-column prop="price" label="价格(元)"></el-table-column>
      <el-table-column prop="inventory" label="库存"></el-table-column>
      <el-table-column label="操作">
        <el-button type="success">充值</el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { getGainVip } from "@/api/vipmanager";
export default {
  meta: {
    title: "vipCharge",
  },
  data() {
    return {
      tableData: [],
    };
  },
  mounted() {
    this.VIPGainFn();
  },
  methods: {
    async VIPGainFn() {
      let res = await getGainVip("20210827165510715");
      if (res.data.status === 200) {
        console.log(res.data.data);
        this.tableData = res.data.data;
      }
    },
  },
};
</script>
<style lang="less" scoped>
/deep/ .cell {
  text-align: center;
}
.imgs {
  width: 80px;
  height: 30px;
}
</style>
